package cn.senjoeson.demo.utils;

import java.io.IOException;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

public class MessageUtils {
    /**
     * 给前台发送消息
     *
     * @param request
     * @param response
     * @throws ServletException
     * @throws IOException
     */
    public static void sendMessage(String whatJsp,HttpServletRequest request, HttpServletResponse response, String message) throws ServletException, IOException {
        request.setAttribute("msg", message);
        request.getRequestDispatcher(whatJsp).forward(request, response);
    }
}
